//
//  NewChangepasswordViewController.m
//  wangzhe
//
//  Created by 李 佳伟 on 2018/4/2.
//  Copyright © 2018年 李 佳伟. All rights reserved.
//

#import "NewChangepasswordViewController.h"
#import "JTCSM.h"
#import "UITextField+PassWord.h"
#import "ForgetPassWordViewController.h"
#import "NewChangeSecondViewController.h"

static CGFloat space = 20;
@interface NewChangepasswordViewController ()

@property (nonatomic,strong) UITextField *mypasswordTextfield;
@end

@implementation NewChangepasswordViewController

- (void)gotBack{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationController.navigationBar.hidden = NO;
    [self.view setBackgroundColor:RGBACOLOR(241, 241, 241, 1)];
    [df isRemoveTarbar:YES];
    leftBarButtonItems_rightBarButtonItems *leftbtn = KCUSTOMNAVIGSTION_ALLOC;
    self.navigationItem.leftBarButtonItem = [leftbtn setBarButtonItemsImageName:@"fanhui.png" frame:KLeftBarButtonItemFrame_image target:self SEL:@selector(gotBack)];
    // Do any additional setup after loading the view.
    
    UIView *headerView = [[UIView alloc]initWithFrame:CGRectMake(0, KagainChangeHeight+10, KCONTROLLERWith, 50)];
    headerView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:headerView];
    self.mypasswordTextfield = [[UITextField alloc]initWithFrame:CGRectMake(space, 0, KCONTROLLERWith-2*space, headerView.LC_height)];
    [self.mypasswordTextfield setTextFieldWithFont:14 color:[df colorWithHexString:@"333333" alpha:1] alignment:NSTextAlignmentLeft title:@"" placeHolder:@"请输入当前登录密码" isSelect:NO];
    [headerView addSubview:self.mypasswordTextfield];
    
    
    NSString *string = @"忘记密码?";
    float font = 15;
    CGFloat labelHeight = 30;
    CGRect rect = [df labelHeightWithContent:string height:labelHeight font:font];
    UILabel *forgetPassWordLabel = [UILabel initWithFrame:CGRectMake(KCONTROLLERWith-rect.size.width-space, KVIEW_Y(headerView)+10, rect.size.width, rect.size.height+3) text:string font:font textAlignment:NSTextAlignmentCenter texcolor:[df colorWithHexString:@"333333" alpha:1] backgroundColor:nil];
    forgetPassWordLabel.userInteractionEnabled = YES;
    [df addTapGestureRecognizerWithTarget:self action:@selector(gotoForgetVC) andaddView:forgetPassWordLabel];
    [self.view addSubview:forgetPassWordLabel];
    [df newlineViewWithHeightofTop:forgetPassWordLabel.LC_height superView:forgetPassWordLabel spacing:0 color:[df colorWithHexString:@"333333" alpha:1] lineHeight:1];
    
    CGFloat btnspace = 20;
    CGFloat btnHeight = 50;
    UIButton *LoginBtn =[[UIButton alloc] initWithFrame:CGRectMake(btnspace, KVIEW_Y(forgetPassWordLabel)+30 , (KCONTROLLERWith-2*btnspace), btnHeight)];
    LoginBtn.backgroundColor =KZhuTiRGB;
    [LoginBtn setTitle:@"下一步" forState:UIControlStateNormal];
    [LoginBtn setTitleColor:[df colorWithHexString:@"333333" alpha:1] forState:UIControlStateNormal];
    LoginBtn.titleLabel.font = [UIFont systemFontOfSize:16];
    [LoginBtn addTarget:self action:@selector(gotoMainV) forControlEvents:UIControlEventTouchUpInside];
    LoginBtn.tag = 10002;
    [self.view addSubview:LoginBtn];
    [df layerWithView:LoginBtn radius:btnHeight/2 width:0 color:nil];
}

- (void)gotoMainV{
    [self gotoNextVC];
}
- (void)gotoNextVC{
    NewChangeSecondViewController *vc = [[NewChangeSecondViewController alloc]init];
    vc.nameTitle = @"设置密码";
    [self.navigationController pushViewController:vc animated:YES];
}

- (void)gotoForgetVC{
    ForgetPassWordViewController *Vc = [[ForgetPassWordViewController alloc]init];
    Vc.nameTitle = @"忘记密码";
    Vc.isShowNav = YES;
    [self.navigationController pushViewController:Vc animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
